﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;


namespace WindowsGame1
{
    class Nave
    {

        private Vector3 pos;
        private Model modelo;

        public Nave(Vector3 pos, Model modelo)
        {
            this.pos = pos;
            this.modelo = modelo;
        }
        
        public void Draw(BasicEffect efeitoBasico, GraphicsDevice graphicDevice){
            modelo.Draw(
                efeitoBasico.World * Matrix.CreateTranslation(pos),
                efeitoBasico.View ,
                efeitoBasico.Projection );
        }

        public void Update(GameTime gameTime, KeyboardState keyState)
        {
            if (keyState.IsKeyDown(Keys.Up))
                pos.Y += 0.05f;
            if (keyState.IsKeyDown(Keys.Down))
                pos.Y -= 0.05f;

            if (keyState.IsKeyDown(Keys.S))
                pos.Z += 0.05f;
            if (keyState.IsKeyDown(Keys.W))
                pos.Z -= 0.05f;

            if (keyState.IsKeyDown(Keys.A))
                pos.X += 0.05f;
            if (keyState.IsKeyDown(Keys.D))
                pos.X -= 0.05f;
        }

    }
}
